home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / man / external.hlp < prev    next >
Text File  |  1997-04-13  |  2KB  |  41 lines

  1. Read this file if you want to call C code from Eiffel code (to 
  2. call Eiffel feature from C see cecil.hlp).
  3.  
  4. The most common way to call C code from Eiffel is to use 
  5. the `external' feature definition as described in ETL.
  6. See also the SmallEiffel directory "lib_sow/external" to 
  7. have some examples.
  8. Here is the current list of SmallEiffel `external' specifications.
  9.  
  10. 1- external "C" -
  11. Simple call to a C function (or procedure). The external called 
  12. routine do not get Current. A C prototype is automatically added
  13. in generated heading C file.
  14.  
  15. 2- external "CWC" -
  16. Call With Current. The external called routine get Current as 
  17. first argument. A C prototype is automatically added in generated
  18. heading C file.
  19.  
  20. 3- external "IC" -
  21. Inlined C call. Same as external "C", but no prototype generated.
  22.  
  23. 4- external "ICWC" -
  24. Inlined CWC call. Same as external "CWC", but no prototype 
  25. generated.
  26.  
  27. 5- external "CSE" -
  28. This external specification is reserved for SmallEiffel itself. Such
  29. a feature is directly treated by `compile_to_c'. For example, infix "+"
  30. of INTEGER is direcly mapped as C '+' for int C type.
  31.  
  32. 6- Inlining C code -
  33. Another way to call C code from Eiffel is to use "c_inline_c" or 
  34. "c_inline_h" as defined in GENERAL. The argument of "c_inline_c"
  35. (or "c_inline_h") must always be a manifest string which may 
  36. contains the C code you want to put inlieu.
  37. Using c_inline_[c/h] also suppose you know exactly the C code
  38. SmallEiffel produce. For portability, it is better to use previous
  39. solutions.
  40.  
  41.